/**
 * 
 */
package las.dao.impl;

import las.dao.entity.UserAchievement;

import org.apache.ibatis.session.SqlSession;

/**
 * @author shayne
 *
 */
public class UserAchievementDao {
	public void save(UserAchievement ua, SqlSession session){
		session.insert("insertUserAch", ua);
	}
	
	public void delete(Integer id, SqlSession session){
		session.delete("deleteUserAch", id);
	}
	
	public void delete(UserAchievement ua, SqlSession session){
		if(ua != null)
		session.delete("deleteUserAch", ua.getId());
	}
	
	public void update(UserAchievement ua, SqlSession session){
		if(ua.getId() != null){
			session.update("updateUserAch", ua);
		}
	}
	
	public UserAchievement selectSimpleOne(Integer id, SqlSession session){
		UserAchievement ua = (UserAchievement)session.selectOne("findSimpleUserAchById", id);
		return ua;
	}
	
	public UserAchievement selectOne(Integer id, SqlSession session){
		UserAchievement ua = (UserAchievement)session.selectOne("findUserAchById", id);
		return ua;
	}
}
